<?php	
$image = imagecreatefromgif('worldmap.gif');

$counter = 0;
for ($x=0; $x<imagesx($image); $x++)
{
	for ($y=0; $y<imagesy($image); $y++)
	{
		$rgb = imagecolorsforindex($image,
			imagecolorat($image, $x, $y));
		if (array_sum($rgb) == 255*3)
		{
			$counter++;
		}
	}
}

echo $counter."\n";
echo imagesx($image)*imagesy($image);
echo "\n";
echo $counter*100/(imagesx($image)*imagesy($image));